<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />


	
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

<div class="container" id="page">

	<div id="header">
		<div id="logo"><?php //echo CHtml::encode(Yii::app()->name); ?></div>
	</div><!-- header -->

	<div id="mainmenu">
		<?php /*$this->widget('zii.widgets.CMenu',array(
			'items'=>array(
				array('label'=>'Home', 'url'=>array('/site/index')),
				//array('label'=>'Test', 'url'=>array('/site/sample')),
				array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
				array('label'=>'Contact', 'url'=>array('/site/contact')),
				array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
				array('label'=>'Project', 'url'=>array('/project/index')), 
				array('label'=>'Property', 'url'=>array('/property/index')), 
				array('label'=>'Testimonials', 'url'=>array('/testimonials/index')), 
				array('label'=>'Picture', 'url'=>array('/picture/index')),
				array('label'=>'Guestbook', 'url'=>array('/guestbook/index')), 
				array('label'=>'Users', 'url'=>array('/users/index')), 
				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
			),
		));*/
		
		$this->widget('application.extensions.menu.SMenu',array(
		"menu"=>array(
			array("url"=>array("route"=>"/site/index"),"label"=>"Home", "icon"=>"protected/images/home2.png"),
				array("url"=>array(
					"link"=>"index.php?r=site/page&view=about"),
					"label"=>"About", 
					"icon"=>"protected/images/about.png"
					),
					array("url"=>array("route"=>"/site/dashboard"),
					"icon"=>"protected/images/admin.png",
					"label"=>"Admin",
					array("url"=>array(
						"route"=>"/site/login"),
						"label"=>"Login",
						"visible"=>Yii::app()->user->isGuest),
					array("url"=>array(
						"route"=>"/site/logout"),
						"label"=>"Logout (".Yii::app()->user->name.")",
						"visible"=>!Yii::app()->user->isGuest),
						array("url"=>array(
							"route"=>"/project/index"),
							"label"=>"Projects",
							"visible"=>!Yii::app()->user->isGuest),
						array("url"=>array(
							"route"=>"/testimonials/index"),
							"label"=>"Testimonials",
							"visible"=>!Yii::app()->user->isGuest),
						array("url"=>array(
							"route"=>"/picture/index"),
							"label"=>"Pictures",
							"visible"=>!Yii::app()->user->isGuest),
						array("url"=>array(
							"route"=>"/guestbook/index"),
							"label"=>"Guestbook",
							"visible"=>!Yii::app()->user->isGuest),
						array("url"=>array(
							"route"=>"/users/index"),
							"label"=>"Users",
							"visible"=>!Yii::app()->user->isGuest),
						array("url"=>array(
							"route"=>"/emailBlast/index"),
							"label"=>"E-mail Blast",
							"visible"=>!Yii::app()->user->isGuest),
						array("url"=>array(
							"route"=>"/pricequote/index"),
							"label"=>"Price Quote Requests",
							"visible"=>!Yii::app()->user->isGuest),
						array("url"=>array(
							"route"=>"/property/index"),
							"label"=>"Properties",
							"visible"=>!Yii::app()->user->isGuest)),
					array("url"=>array(
					"link"=>"index.php?r=listView/index"),
					"icon"=>"protected/images/list.png",
					"label"=>"List View"),					
					array("url"=>array(
					"link"=>"index.php?r=mapview/index"),
					"icon"=>"protected/images/map.png",
					"label"=>"Map View"),
					array("url"=>array(
					"link"=>"index.php?r=guestbook/create"),
					"icon"=>"protected/images/find.png",
					"label"=>"Guestbook"),
          ),
	"stylesheet"=>"menu_white.css",
	"menuID"=>"myMenu",
	"delay"=>3
)
);
		
		
		?>
	</div><!-- mainmenu -->
	<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	<?php endif?>

	<?php echo $content; ?>

	<div class="clear"></div>

	<div id="footer">
		Copyright &copy; <?php echo date('Y'); ?> by The Dragon Warriors Minus Po &#8482<br/>
		All Rights Reserved.<br/>
		<?php echo Yii::powered(); ?>
	</div><!-- footer -->

</div><!-- page -->
<div class="notifications" style="display: none;">
</div>
</body>

	<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.min.js"></script>
	<!--script>
		var latest = null;
		var url = "<?php echo $this->createUrl('notification/index',array('type'=>'json'))?>";
		var guestbook_url = "<?php echo $this->createUrl('guestbook/view')?>";
		
		function load_notifications(){
			$.ajax({
				//url: '/rlc-cms/index.php?r=notification/index&type=json',
				url: url,
				type: 'GET',
				dataType: 'json',
				cache: false,
				success: function(data){				
					if(data.length != 0){
						if(latest === null){
							latest = data;
							$('.notifications').empty();
							//$('.notifications').append("<?php echo CHtml::link('guestbook/view', array('id'=>"+data.guestbook_view_id+"), array('class'=>'button'));?>").fadeIn('slow').delay(2000).fadeOut('slow');
							$('.notifications').append("<a class='button' href='"+guestbook_url+"&id=" +data.guestbook_view_id+ "'>new guestbook update</a >").fadeIn('slow').delay(2000).fadeOut('slow');
						}else{
							if(data.guestbook_view_id !== latest.guestbook_view_id){
								$('.notifications').empty();
								$('.notifications').append("<a class='button' href='"+guestbook_url+"&id=" +data.guestbook_view_id+ "'>new guestbook update</a >").fadeIn('slow').delay(2000).fadeOut('slow');
								//$('.notifications').append("<a href='/rlc-cms/index.php?r=guestbook/view&id=" +data.guestbook_view_id+ "'>new guestbook update</a>").fadeIn('slow').delay(2000).fadeOut('slow');
								latest = data;
							}
						}
					}
				},
				error: function(data){}
			});
		}
	
		$(function(){
			setInterval(load_notifications, 1000);
		});
		
		
	</script-->
</html>
